﻿@using AntDesignTemplate.Shared.Services

@inject ILoginService LoginService

<AuthorizeView>
    <Authorized>
        <a href="authentication/profile">Hello, @context.User.Identity.Name!</a>
        <Button Type="link" @onclick="BeginSignOut">Log out</Button>
    </Authorized>
    <NotAuthorized>
        <a href="authentication/register">Register</a>
        <a href="authentication/login">Log in</a>
    </NotAuthorized>
</AuthorizeView>

@code{
    private async Task BeginSignOut(MouseEventArgs args)
    {
        await LoginService.SignOut();
    }
}
